home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 005 / pccheck.arc / PC-CHECK.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1984-09-18  |  46.7 KB  |  1,303 lines

  1. Program PC_Check;
  2.  
  3. {$C-}
  4.  
  5. {      PC-Check Copyright (c)  The Forbin Project and John Friel III
  6.  
  7.        PC-Check  is a checkbook and  savings  record  keeper  produced
  8.        by the  Forbin  Project.   Like some public domain software, we
  9.        are asking  for a  donation  for  the use  of this program.   A
  10.        donation of  only $5.00  is requested.   Those that  do  donate
  11.        will  receive  published announcements  for future enhancements
  12.        to  PC-Check  and other programs written by the Forbin Project.
  13.        PC-Check  may  be  transferred  to  other people  under two (2)
  14.        conditions;  that there is  NO CHARGE  for the copy(s) and that
  15.        the source program  not be modified in  any way, shape or form.
  16.        The user  may  modify  the source code  to suit his  or her own
  17.        personal tastes.    All rights reserved by the  Forbin Project.
  18.        Please keep an unmodified  copy  around just for  this purpose.
  19.        For  more  information  on  this  program  or   more   detailed
  20.        information  on interfacing  TURBO Pascal  with the  IBM PC  or
  21.        Compatibles, (this was developed on a Tava PC!) please write to
  22.        the Forbin Project at :
  23.  
  24.                           The Forbin Project
  25.                           John Friel III
  26.                           715 Walnut Street
  27.                           Cedar Falls, Iowa  50613
  28. }
  29.  
  30. Const
  31.   blink_yes        = true;
  32.   blink_no         = false;
  33.   yes_no           : set of char = ['Y','y','N','n'];
  34.   filechars        : set of char = ['A'..'Z','a'..'z','0'..'9',':',
  35.                                     '!','$','@','#','%','-','&'];
  36.  
  37. type
  38.   check_trans  = (cdeposit, cwithdrawl, cinterest,
  39.                   sdeposit, swithdrawl, sinterest);
  40.   check_type   = record
  41.                    post_date : string[8];
  42.                    check_no  : integer;
  43.                    to_who    : string[40];
  44.                    amount    : real;
  45.                    memo      : string[30];
  46.                    check_tran: check_trans;
  47.                    cleared   : boolean;
  48.                  end;
  49.   Names            = String[80];
  50.   Screen_Array     = Array [1..4000] of byte;
  51.   months           = 1..12;
  52.   days             = 1..31;
  53.   years            = 0..99;
  54.   xxxstr80         = string[80];
  55.   xxxstr8          = string[8];
  56.   xxxfile          = file;
  57.  
  58. Var
  59.   n_amount,temp_date            : string[8];
  60.   n_check_num                   : string[5];
  61.   new_amount, amount_h          : real;
  62.   t_cdc, t_cwc, t_cic,
  63.   t_sdc, t_swc, t_sic,
  64.   t_cdu, t_cwu, t_ciu,
  65.   t_sdu, t_swu, t_siu,
  66.   tcc, tcs, rbs, rbc            : real;
  67.   rc, check_num_h               : integer;
  68.   trnfile                       : file of check_type;
  69.   one_trn                       : check_type;
  70.   x, i, y, q, e, w, check_num,
  71.   crt_reg, z                    : Integer;
  72.   to_whom, to_who_h             : string[40];
  73.   new_memo, memo_h              : string[30];
  74.   Ok, bool, done, edit_ok       : Boolean;
  75.   FileName                      : Names;
  76.   Real_Screen                   : Screen_Array absolute $B800:$0000;
  77.   Temp_Screen, temp_Screen2     : Screen_Array;
  78.   Ch, ch1,ch2                   : Char;
  79.   check_tran_h                  : check_trans;
  80.  
  81.  
  82. procedure screen_off;
  83. begin
  84.   crt_reg := $c;
  85.   port[$3d4] := crt_reg;
  86.   z := port[$3d5];
  87.   port[$3d4] := crt_reg;
  88.   port[$3d5] := $8;
  89. end;
  90.  
  91.  
  92. procedure screen_on;
  93. begin
  94.   port[$3d4] := crt_reg;
  95.   port[$3d5] := z;
  96. end;
  97.  
  98.  
  99.  
  100. function readdate(x,y:integer; indate:xxxstr8):xxxstr8;
  101. {  reads a string from the terminal from screen at position xy  }
  102. {    the string will contain a Valid date in format 00/00/00  }
  103. Var
  104.    hold : array [1..6] of char;
  105.    location : integer;
  106.    inchar : char;
  107.  
  108. begin
  109.    location := 1;
  110.    gotoxy(x,y);
  111.    if indate = '' then
  112.      write('MM/DD/YY')
  113.    else
  114.      write(indate);
  115.    gotoxy(x,y);
  116.    while location<8 do
  117.       begin
  118.          read(kbd,inchar);
  119.          case location of
  120.             1:
  121.                begin
  122.                   gotoxy(x,y);
  123.                   if inchar in ['1','0',' '] then
  124.                      begin
  125.                         hold[1] := inchar;
  126.                         write(inchar);
  127.                         location := 2;
  128.                         gotoxy((x+1),y);
  129.                      end
  130.                   else
  131.                      begin
  132.                         write(chr(7));
  133.                      end;
  134.                end;
  135.             2:
  136.                begin
  137.                   gotoxy((x+1),y);
  138.                   if inchar in ['1'..'9','0'] then
  139.                      if hold[1]='1' then
  140.                         if inchar in ['1','2','0'] then
  141.                            begin
  142.                               hold[2] := inchar;
  143.                               write(inchar);
  144.                               location := 3;
  145.                            end
  146.                         else
  147.                            begin
  148.                               write(chr(7));
  149.                            end
  150.                      else
  151.                         begin
  152.                            write(inchar);
  153.                            hold[2] := inchar;
  154.                            location := 3;
  155.                         end
  156.                   else
  157.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  158.                         begin
  159.                            gotoxy(x,y);
  160.                            write(' ');
  161.                            location := 1;
  162.                            hold[1] := ' ';
  163.                            gotoxy(x,y);
  164.                         end
  165.                      else
  166.                         begin
  167.                            write(chr(7));
  168.                         end;
  169.                end;
  170.             3:
  171.                begin
  172.                   gotoxy((x+3),y);
  173.                   if inchar in ['1'..'3','0',' '] then
  174.                      begin
  175.                         hold[3] := inchar;
  176.                         write(inchar);
  177.                         location := 4;
  178.                         gotoxy((x+4),y);
  179.                      end
  180.                   else
  181.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  182.                         begin
  183.                            gotoxy((x+1),y);
  184.                            write(' ');
  185.                            location := 2;
  186.                            hold[2] := ' ';
  187.                            gotoxy((x+1),y);
  188.                         end
  189.                      else
  190.                         begin
  191.                            write(chr(7));
  192.                         end;
  193.                end;
  194.             4:
  195.                begin
  196.                   gotoxy((x+4),y);
  197.                   if inchar in ['1'..'9','0'] then
  198.                      begin
  199.                         hold[4] := inchar;
  200.                         write(inchar);
  201.                         location := 5;
  202.                         gotoxy((x+6),y);
  203.                      end
  204.                   else
  205.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  206.                         begin
  207.                            gotoxy((x+3),y);
  208.                            write(' ');
  209.                            location := 3;
  210.                            hold[3] := ' ';
  211.                            gotoxy((x+3),y);
  212.                         end
  213.                      else
  214.                         begin
  215.                            write(chr(7));
  216.                         end;
  217.                end;
  218.             5:
  219.                begin
  220.                   gotoxy((x+6),y);
  221.                   if inchar in ['1'..'9','0'] then
  222.                      begin
  223.                         hold[5] := inchar;
  224.                         write(inchar);
  225.                         location := 6;
  226.                         gotoxy((x+7),y);
  227.                      end
  228.                   else
  229.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  230.                         begin
  231.                            gotoxy((x+4),y);
  232.                            write(' ');
  233.                            location := 4;
  234.                            hold[4] := ' ';
  235.                            gotoxy((x+4),y);
  236.                         end
  237.                      else
  238.                         begin
  239.                            write(chr(7));
  240.                         end;
  241.                end;
  242.             6:
  243.                begin
  244.                   gotoxy((x+7),y);
  245.                   if inchar in ['1'..'9','0'] then
  246.                      begin
  247.                         hold[6] := inchar;
  248.                         write(inchar);
  249.                         location := 7;
  250.                      end
  251.                   else
  252.                      if ((inchar = chr(8)) or (inchar = chr(7))) then
  253.                         begin
  254.                            gotoxy((x+6),y);
  255.                            write(' ');
  256.                            location := 5;
  257.                            hold[5] := ' ';
  258.                            gotoxy((x+6),y);
  259.                         end
  260.                      else
  261.                         begin
  262.                            write(chr(7));
  263.                         end;
  264.                end;
  265.             7:
  266.                begin
  267.                   if ((inchar=chr(11)) or (inchar=chr(13))) then
  268.                      location := 8
  269.                   else
  270.                      if ((inchar=chr(8)) or (inchar=chr(7))) then
  271.                         begin
  272.                            gotoxy((x+7),y);
  273.                            write(' ');
  274.                            location := 6;
  275.                            hold[6] := ' ';
  276.                            gotoxy((x+7),y);
  277.                         end;
  278.                end;
  279.          end;
  280.       end;
  281.    readdate := hold[1]+hold[2]+'/'+hold[3]+hold[4]+'/'+hold[5]+hold[6];
  282. end;
  283.  
  284.  
  285. Procedure Big_exit;
  286. begin
  287.   close (trnfile);
  288.   textbackground(black);
  289.   textcolor(yellow);
  290.   window (1,1,80,25);
  291.   for x := 10 downto 1 do
  292.     for y := 2 downto 1 do
  293.       begin
  294.         window (x+y-1,x+4,82-x-y,25-x);
  295.         clrscr;
  296.         delay (5);
  297.       end;
  298.   gotoxy (29,12);
  299.   write ('PC-Check has Completed.');
  300.   halt;
  301. end;
  302.  
  303. Procedure Drawbox_IBM (x1,y1,x2,y2,FG,BG : Integer; boxname : Names; blnk : boolean);
  304. Begin
  305.   window (x1,y1,x2,y1+1);
  306.   textbackground(BG);
  307.   GotoXY(1,1);
  308.   x := x2-x1;
  309.   if length(boxname) > x then boxname[0] := chr(x-4);
  310.   textcolor(FG);
  311.   Write('╒');
  312.   if blnk then textcolor(FG + blink) else textcolor(fg);
  313.   write (boxname);
  314.   textcolor(FG);
  315.   for q := x1+length(boxname)+1 to x2-1 do Write('═');
  316.   Write('╕');
  317.   for q := 2 to y2-y1 do
  318.     Begin
  319.       window (x1,y1,x2,y1+q+1);
  320.       GotoXY(1,q); Write('│');
  321.       if blnk then clreol;
  322.       GotoXY(x2-x1+1,q); Write('│');
  323.     end;
  324.   Window(x1,y1,x2,y2+1);
  325.   gotoXY(1,y2-y1+1);
  326.   Write('╘');
  327.   for q := x1+1 to x2-1 do Write('═');
  328.   Write('╛');
  329. end;
  330.  
  331. Procedure Drawbox (x1,y1,x2,y2,FG,BG : Integer; boxname : Names; blnk : boolean);
  332. Begin
  333.   Drawbox_IBM (x1,y1,x2,y2,FG,BG,boxname,blnk);
  334.   Window (x1+1,y1+1,x2-1,y2-1);
  335.   Clrscr;
  336. end;
  337.  
  338.  
  339. Procedure Init;
  340. Begin
  341.   textcolor(white);
  342.   done := False;
  343.   Window (1,1,80,25);
  344.   ClrScr;
  345.   Drawbox (1,1,80,4,lightgreen,black,'',blink_yes);
  346.   textcolor(yellow);
  347.   assign (trnfile,'dummy');
  348.   Writeln ('                              PC-Check  v1.1');
  349.   Write   ('     (c) The Forbin Project   1 September 1984   Using TURBO Pascal');
  350. end;
  351.  
  352. procedure open_files;
  353. var
  354.   file_ok,colon : boolean;
  355. begin
  356.   Drawbox (1,5,80,14,yellow,red,'[ File Allocation ]',blink_yes);
  357.   close (trnfile);
  358.   repeat
  359.     writeln;
  360.     write  ('Enter Transaction file name  (x:xxxxxxxx)  ');
  361.     buflen := 10;
  362.     readln (filename);
  363.     file_ok := true;
  364.     colon := false;
  365.     ok := false;
  366.     for q := 1 to length(filename) do
  367.       begin
  368.         if not (filename[q] in filechars) then
  369.           file_ok := false;
  370.         if (filename[q] = ':') and (q <> 2) then
  371.           file_ok := false;
  372.         if filename[q] = ':' then colon := true;
  373.       end;
  374.     if (not colon) and (length(filename) > 8) then file_ok := false;
  375.     if colon and (length(filename) < 3) then file_ok := false;
  376.     if (length(filename) <> 0) and file_ok then
  377.       begin
  378.         filename := filename + '.CHK';
  379.         assign (trnfile, filename);
  380.         {$I-} reset (trnfile); {$I+}
  381.         ok := (ioresult = 0);
  382.         if not ok then
  383.           begin
  384.             write ('File does not exist. create it  (Y/N) ? ');
  385.             repeat
  386.               read (kbd, ch);
  387.             until ch in yes_no;
  388.             if ch in ['Y','y'] then
  389.               begin
  390.                 ok := true;
  391.                 rewrite (trnfile);
  392.               end
  393.           end;
  394.       end
  395.     else
  396.       begin
  397.         ok := false;
  398.         write ('Invalid filename. Do you want to Quit ? ');
  399.         repeat read (kbd, ch); until ch in yes_no;
  400.         if ch in ['Y','y'] then big_exit;
  401.         writeln;
  402.       end;
  403.   until ok;
  404.   Drawbox_ibm (1,5,80,14,yellow,red,'[ File Allocation ]',blink_no);
  405. end;
  406.  
  407. procedure CD;
  408. begin
  409.   Drawbox (1,5,80,14,lightgreen,black,'[ Checking Deposit ]',blink_yes);
  410.   repeat
  411.     textcolor (white);
  412.     gotoxy (5,1);   write ('Date');
  413.     gotoxy (5,3);  write ('Amount ________');
  414.     gotoxy (5,5);   write ('Memo ______________________________');
  415.     { get date }
  416.     textcolor (lightcyan);
  417.     repeat
  418.       temp_date := readdate(10,1,'');
  419.       { get amount }
  420.       repeat
  421.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  422.         val (n_amount, new_amount, rc);
  423.         if rc <> 0 then
  424.           begin
  425.             gotoxy (5,7);
  426.             writeln ('Error in Amount at position ',rc:1);
  427.           end;
  428.       until rc = 0;
  429.       gotoxy (5,7); clreol;
  430.       { get memo }
  431.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  432.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  433.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  434.       repeat
  435.         read (kbd, ch);
  436.       until ch in yes_no;
  437.       case ch of
  438.         'N','n'  :  begin
  439.                       gotoxy (5,7); clreol;
  440.                       write ('Do you want to EXIT (Y/N) ? ');
  441.                       repeat
  442.                         read (kbd, ch1);
  443.                       until ch1 in yes_no;
  444.                     end;
  445.         'Y','y'  :  ch1 := 'N';
  446.       end; { case }
  447.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  448.     if ch in ['Y','y'] then
  449.       begin
  450.         with one_trn do
  451.           begin
  452.             post_date := temp_date;
  453.             check_no  := 0;
  454.             to_who    := '                                         ';
  455.             amount    := new_amount;
  456.             memo      := new_memo;
  457.             check_tran := cdeposit;
  458.             cleared    := false;
  459.           end; { with }
  460.         seek (trnfile, filesize(trnfile));
  461.         write (trnfile, one_trn);
  462.       end;
  463.     gotoxy (5,7); clreol;
  464.     write ('Do you want to EXIT (Y/N)  ');
  465.     repeat
  466.       read (kbd, ch1);
  467.     until ch1 in yes_no;
  468.   until ch1 in ['y','Y'];
  469. end;
  470.  
  471. procedure CW;
  472. begin
  473.   Drawbox (1,5,80,14,lightgreen,black,'[ Checking Withdrawl  --  Blank Check ]',blink_yes);
  474.   repeat
  475.     textcolor (white);
  476.     gotoxy (5,1);   write ('Date');
  477.     gotoxy (60,1);  write ('Check Number _____');
  478.     gotoxy (5,3);   write ('Pay to ________________________________________');
  479.     gotoxy (60,3);  write ('Amount ________');
  480.     gotoxy (5,5);   write ('Memo ______________________________');
  481.     { get date }
  482.     textcolor (lightcyan);
  483.     repeat
  484.       temp_date := readdate(10,1,'');
  485.       { get check number }
  486.       repeat
  487.         gotoxy (73,1);  buflen := 5;  readln (n_check_num);
  488.         val (n_check_num, check_num, rc);
  489.         if rc <> 0 then
  490.           begin
  491.             gotoxy (5,7);
  492.             writeln ('Error : Numeric input only.');
  493.           end;
  494.       until rc = 0;
  495.       gotoxy (5,7); clreol;
  496.       { get to_who }
  497.       gotoxy (12,3);  buflen := 40; readln (to_whom);
  498.       { get amount }
  499.       repeat
  500.         gotoxy (67,3);  buflen := 8;  readln (n_amount);
  501.         val (n_amount, new_amount, rc);
  502.         if rc <> 0 then
  503.           begin
  504.             gotoxy (5,7);
  505.             writeln ('Error in Amount at position ',rc:1);
  506.           end;
  507.       until rc = 0;
  508.       gotoxy (5,7); clreol;
  509.       { get memo }
  510.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  511.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  512.       while length(to_whom) < 40 do to_whom := to_whom + ' ';
  513.       gotoxy (5,7);   write ('Is this check right  (Y/N)  ');
  514.       repeat
  515.         read (kbd, ch);
  516.       until ch in yes_no;
  517.       case ch of
  518.         'N','n'  :  begin
  519.                       gotoxy (5,7);
  520.                       write ('Do you want to EXIT (Y/N)  ');
  521.                       repeat
  522.                         read (kbd, ch1);
  523.                       until ch1 in yes_no;
  524.                     end;
  525.         'Y','y'  :  ch1 := 'N';
  526.       end; { case }
  527.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  528.     if ch in ['Y','y'] then
  529.       begin
  530.         with one_trn do
  531.           begin
  532.             post_date := temp_date;
  533.             check_no  := check_num;
  534.             to_who    := to_whom;
  535.             amount    := new_amount;
  536.             memo      := new_memo;
  537.             check_tran := cwithdrawl;
  538.             cleared    := false;
  539.           end; { with }
  540.         seek (trnfile, filesize(trnfile));
  541.         write (trnfile, one_trn);
  542.       end;
  543.     gotoxy (5,7);
  544.     write ('Do you want to EXIT (Y/N)  ');
  545.     repeat
  546.       read (kbd, ch1);
  547.     until ch1 in yes_no;
  548.   until ch1 in ['y','Y'];
  549. end;
  550.  
  551. procedure CI;
  552. begin
  553.   Drawbox (1,5,80,14,lightgreen,black,'[ Checking Interest Deposit ]',blink_yes);
  554.   repeat
  555.     textcolor (white);
  556.     gotoxy (5,1);  write ('Date');
  557.     gotoxy (5,3);  write ('Amount ________');
  558.     { get date }
  559.     textcolor (lightcyan);
  560.     repeat
  561.       temp_date := readdate(10,1,'');
  562.       { get amount }
  563.       repeat
  564.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  565.         val (n_amount, new_amount, rc);
  566.         if rc <> 0 then
  567.           begin
  568.             gotoxy (5,7);
  569.             writeln ('Error in Amount at position ',rc:1);
  570.           end;
  571.       until rc = 0;
  572.       gotoxy (5,7); clreol;
  573.       gotoxy (5,7);   write ('Is this right  (Y/N)  ');
  574.       repeat
  575.         read (kbd, ch);
  576.       until ch in yes_no;
  577.       case ch of
  578.         'N','n'  :  begin
  579.                       gotoxy (5,7);
  580.                       write ('Do you want to EXIT (Y/N)  ');
  581.                       repeat
  582.                         read (kbd, ch1);
  583.                       until ch1 in yes_no;
  584.                     end;
  585.         'Y','y'  :  ch1 := 'N';
  586.       end; { case }
  587.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  588.     if ch in ['Y','y'] then
  589.       begin
  590.         with one_trn do
  591.           begin
  592.             post_date := temp_date;
  593.             check_no  := 0;
  594.             to_who    := '                                         ';
  595.             amount    := new_amount;
  596.             memo      := 'Checking Interest              ';
  597.             check_tran := cinterest;
  598.             cleared    := false;
  599.           end; { with }
  600.         seek (trnfile, filesize(trnfile));
  601.         write (trnfile, one_trn);
  602.       end;
  603.     gotoxy (5,7);
  604.     write ('Do you want to EXIT (Y/N)  ');
  605.     repeat
  606.       read (kbd, ch1);
  607.     until ch1 in yes_no;
  608.   until ch1 in ['y','Y'];
  609. end;
  610.  
  611. procedure SD;
  612. begin
  613.   Drawbox (1,5,80,14,lightgreen,black,'[ Savings Deposit ]',blink_yes);
  614.   repeat
  615.     textcolor (white);
  616.     gotoxy (5,1);   write ('Date');
  617.     gotoxy (5,3);   write ('Amount ________');
  618.     gotoxy (5,5);   write ('Memo ______________________________');
  619.     { get date }
  620.     textcolor (lightcyan);
  621.     repeat
  622.       temp_date := readdate(10,1,'');
  623.       { get amount }
  624.       repeat
  625.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  626.         val (n_amount, new_amount, rc);
  627.         if rc <> 0 then
  628.           begin
  629.             gotoxy (5,7);
  630.             writeln ('Error in Amount at position ',rc:1);
  631.           end;
  632.       until rc = 0;
  633.       gotoxy (5,7); clreol;
  634.       { get memo }
  635.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  636.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  637.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  638.       repeat
  639.         read (kbd, ch);
  640.       until ch in yes_no;
  641.       case ch of
  642.         'N','n'  :  begin
  643.                       gotoxy (5,7); clreol;
  644.                       write ('Do you want to EXIT (Y/N) ? ');
  645.                       repeat
  646.                         read (kbd, ch1);
  647.                       until ch1 in yes_no;
  648.                     end;
  649.         'Y','y'  :  ch1 := 'N';
  650.       end; { case }
  651.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  652.     if ch in ['Y','y'] then
  653.       begin
  654.         with one_trn do
  655.           begin
  656.             post_date := temp_date;
  657.             check_no  := 0;
  658.             to_who    := '                                         ';
  659.             amount    := new_amount;
  660.             memo      := new_memo;
  661.             check_tran := sdeposit;
  662.             cleared    := false;
  663.           end; { with }
  664.         seek (trnfile, filesize(trnfile));
  665.         write (trnfile, one_trn);
  666.       end;
  667.     gotoxy (5,7); clreol;
  668.     write ('Do you want to EXIT (Y/N)  ');
  669.     repeat
  670.       read (kbd, ch1);
  671.     until ch1 in yes_no;
  672.   until ch1 in ['y','Y'];
  673. end;
  674.  
  675. procedure SW;
  676. begin
  677.   Drawbox (1,5,80,14,lightgreen,black,'[ Savings Withdrawl ]',blink_yes);
  678.   repeat
  679.     textcolor (white);
  680.     gotoxy (5,1);   write ('Date');
  681.     gotoxy (5,3);   write ('Amount ________');
  682.     gotoxy (5,5);   write ('Memo ______________________________');
  683.     { get date }
  684.     textcolor (lightcyan);
  685.     repeat
  686.       temp_date := readdate(10,1,'');
  687.       { get amount }
  688.       repeat
  689.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  690.         val (n_amount, new_amount, rc);
  691.         if rc <> 0 then
  692.           begin
  693.             gotoxy (5,7);
  694.             writeln ('Error in Amount at position ',rc:1);
  695.           end;
  696.       until rc = 0;
  697.       gotoxy (5,7); clreol;
  698.       { get memo }
  699.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  700.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  701.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  702.       repeat
  703.         read (kbd, ch);
  704.       until ch in yes_no;
  705.       case ch of
  706.         'N','n'  :  begin
  707.                       gotoxy (5,7); clreol;
  708.                       write ('Do you want to EXIT (Y/N) ? ');
  709.                       repeat
  710.                         read (kbd, ch1);
  711.                       until ch1 in yes_no;
  712.                     end;
  713.         'Y','y'  :  ch1 := 'N';
  714.       end; { case }
  715.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  716.     if ch in ['Y','y'] then
  717.       begin
  718.         with one_trn do
  719.           begin
  720.             post_date := temp_date;
  721.             check_no  := 0;
  722.             to_who    := '                                         ';
  723.             amount    := new_amount;
  724.             memo      := new_memo;
  725.             check_tran := swithdrawl;
  726.             cleared    := false;
  727.           end; { with }
  728.         seek (trnfile, filesize(trnfile));
  729.         write (trnfile, one_trn);
  730.       end;
  731.     gotoxy (5,7); clreol;
  732.     write ('Do you want to EXIT (Y/N)  ');
  733.     repeat
  734.       read (kbd, ch1);
  735.     until ch1 in yes_no;
  736.   until ch1 in ['y','Y'];
  737. end;
  738.  
  739. procedure SI;
  740. begin
  741.   Drawbox (1,5,80,14,lightgreen,black,'[ Savings Interest ]',blink_yes);
  742.   repeat
  743.     textcolor (white);
  744.     gotoxy (5,1);   write ('Date');
  745.     gotoxy (5,3);   write ('Amount ________');
  746.     gotoxy (5,5);   write ('Memo ______________________________');
  747.     { get date }
  748.     textcolor (lightcyan);
  749.     repeat
  750.       temp_date := readdate(10,1,'');
  751.       { get amount }
  752.       repeat
  753.         gotoxy (12,3);  buflen := 8;  readln (n_amount);
  754.         val (n_amount, new_amount, rc);
  755.         if rc <> 0 then
  756.           begin
  757.             gotoxy (5,7);
  758.             writeln ('Error in Amount at position ',rc:1);
  759.           end;
  760.       until rc = 0;
  761.       gotoxy (5,7); clreol;
  762.       { get memo }
  763.       gotoxy (10,5);  buflen := 30; readln (new_memo);
  764.       while length(new_memo) < 30 do new_memo := new_memo + ' ';
  765.       gotoxy (5,7);   write ('Is this deposit right  (Y/N)  ');
  766.       repeat
  767.         read (kbd, ch);
  768.       until ch in yes_no;
  769.       case ch of
  770.         'N','n'  :  begin
  771.                       gotoxy (5,7); clreol;
  772.                       write ('Do you want to EXIT (Y/N) ? ');
  773.                       repeat
  774.                         read (kbd, ch1);
  775.                       until ch1 in yes_no;
  776.                     end;
  777.         'Y','y'  :  ch1 := 'N';
  778.       end; { case }
  779.     until (ch in ['Y','y']) or (ch1 in ['Y','y']);
  780.     if ch in ['Y','y'] then
  781.       begin
  782.         with one_trn do
  783.           begin
  784.             post_date := temp_date;
  785.             check_no  := 0;
  786.             to_who    := '                                         ';
  787.             memo      := new_memo;
  788.             amount    := new_amount;
  789.             check_tran := sinterest;
  790.             cleared    := false;
  791.           end; { with }
  792.         seek (trnfile, filesize(trnfile));
  793.         write (trnfile, one_trn);
  794.       end;
  795.     gotoxy (5,7); clreol;
  796.     write ('Do you want to EXIT (Y/N)  ');
  797.     repeat
  798.       read (kbd, ch1);
  799.     until ch1 in yes_no;
  800.   until ch1 in ['y','Y'];
  801. end;
  802.  
  803. procedure Balance_sheet;    { the CHK file will be closed and reopened }
  804. var
  805.    tt : integer;
  806. begin
  807.   tt := 0;
  808.   t_cdc := 0.0; t_cwc := 0.0; t_cic := 0.0; t_sdc := 0.0;
  809.   t_swc := 0.0; t_sic := 0.0; t_cdu := 0.0; t_cwu := 0.0;
  810.   t_ciu := 0.0; t_sdu := 0.0; t_swu := 0.0; t_siu := 0.0;
  811.   tcc   := 0.0; tcs   := 0.0; rbs   := 0.0; rbc   := 0.0;
  812.   move (real_screen, temp_screen, 4000);
  813.   drawbox (2,6,79,23,white,black,'[ Balance Sheet ]',blink_yes);
  814.   gotoxy (27,2); write ('Deposits          Withdrawls          Interest');
  815.   gotoxy (1,3);  write ('Cleared');
  816.   gotoxy (3,4);  write ('Checking');
  817.   gotoxy (3,5);  write ('Savings');
  818.   gotoxy (1,7);  write ('Uncleared');
  819.   gotoxy (3,8);  write ('Checking');
  820.   gotoxy (3,9); write ('Savings');
  821.   gotoxy (25,11); write ('Checking            Savings');
  822.   gotoxy (3,13);  write ('Total Cleared');
  823.   gotoxy (4,14);  write ('Real Balance');
  824.   textcolor (lightgreen);
  825.   close (trnfile);                 { save buffered transactions }
  826.   assign (trnfile, filename);
  827.   reset (trnfile);
  828.   while not eof(trnfile) do
  829.     begin
  830.       read (trnfile, one_trn);
  831.       case one_trn.check_tran of
  832.         cdeposit    : if one_trn.cleared then
  833.                         t_cdc := t_cdc + one_trn.amount
  834.                       else
  835.                         t_cdu := t_cdu + one_trn.amount;
  836.         cwithdrawl  : if one_trn.cleared then
  837.                         t_cwc := t_cwc + one_trn.amount
  838.                       else
  839.                         t_cwu := t_cwu + one_trn.amount;
  840.         cinterest   : if one_trn.cleared then
  841.                         t_cic := t_cic + one_trn.amount
  842.                       else
  843.                         t_ciu := t_ciu + one_trn.amount;
  844.         sdeposit    : if one_trn.cleared then
  845.                         t_sdc := t_sdc + one_trn.amount
  846.                       else
  847.                         t_sdu := t_sdu + one_trn.amount;
  848.         swithdrawl  : if one_trn.cleared then
  849.                         t_swc := t_swc + one_trn.amount
  850.                       else
  851.                         t_swu := t_swu + one_trn.amount;
  852.         sinterest   : if one_trn.cleared then
  853.                         t_sic := t_sic + one_trn.amount
  854.                       else
  855.                         t_siu := t_siu + one_trn.amount;
  856.       end; { case }
  857.       tt := tt + 1;
  858.     end; { while }
  859.   tcc := t_cdc + t_cic - t_cwc;
  860.   tcs := t_sdc + t_sic - t_swc;
  861.   rbc := tcc + t_cdu + t_ciu - t_cwu;
  862.   rbs := tcs + t_sdu + t_siu - t_swu;
  863.   { now locate the totals on the screen }
  864.   gotoxy (25,4); write (t_cdc:8:2,'           ',t_cwc:8:2,'           ',t_cic:8:2);
  865.   gotoxy (25,5); write (t_sdc:8:2,'           ',t_swc:8:2,'           ',t_sic:8:2);
  866.   gotoxy (25,8); write (t_cdu:8:2,'           ',t_cwu:8:2,'           ',t_ciu:8:2);
  867.   gotoxy (25,9); write (t_sdu:8:2,'           ',t_swu:8:2,'           ',t_siu:8:2);
  868.   if tcc < 0 then textcolor (lightred);
  869.   gotoxy (25,13); write (tcc:8:2);
  870.   textcolor (lightgreen);
  871.   if tcs < 0 then textcolor (lightred);
  872.   gotoxy (44,13); write (tcs:8:2);
  873.   textcolor (lightgreen);
  874.   if rbc < 0 then textcolor (lightred);
  875.   gotoxy (25,14); write (rbc:8:2);
  876.   textcolor (lightgreen);
  877.   if rbs < 0 then textcolor (lightred);
  878.   gotoxy (44,14); write (rbs:8:2);
  879.   textcolor (lightblue);
  880.   gotoxy (5,16);  write ('Total Transaction = ',tt:4);
  881.   gotoxy (40,16); write ('Press any key to Return ');
  882.   read (kbd,ch);
  883.   move (temp_screen, real_screen, 4000);
  884. end;
  885.  
  886. procedure add_a_trn;
  887. begin
  888.   repeat
  889.     Drawbox (1,5,80,14,white,blue,'[ Transaction Menu ]',blink_yes);
  890.     writeln;
  891.     writeln ('Options:');
  892.     writeln ('        1)  Checking Deposit            4)  Savings Deposit');
  893.     writeln ('        2)  Checking Withdrawl          5)  Savings Withdrawl');
  894.     writeln ('        3)  Checking Interest           6)  Savings Interest');
  895.     writeln ('                                        7)  Exit');
  896.     write   ('                 Choice? ');
  897.     repeat
  898.       read (kbd, ch);
  899.     until ch in ['1'..'7'];
  900.     case ch of
  901.       '1'   :  CD;
  902.       '2'   :  CW;
  903.       '3'   :  CI;
  904.       '4'   :  SD;
  905.       '5'   :  SW;
  906.       '6'   :  SI;
  907.     end
  908.   until ch = '7';
  909.   Drawbox_ibm (1,5,80,14,white,blue,'[ Transaction Menu ]',blink_no);
  910. end;
  911.  
  912. procedure Clear_entries;
  913. var
  914.   tt, tc : integer;
  915. begin
  916.   tt := 0;  tc := 0;
  917.   move (real_screen, temp_screen, 4000);
  918.   drawbox (2,6,79,20,yellow,blue,'[ Clear Transactions ]',blink_yes);
  919.   close (trnfile);
  920.   assign (trnfile, filename);
  921.   reset (trnfile);
  922.   writeln ('    For every transaction displayed, ');
  923.   writeln ('    press ''Y'', ''N'' or ''Q''');
  924.   while not eof(trnfile) do
  925.     begin
  926.       read (trnfile, one_trn);
  927.       tt := tt + 1;
  928.       if not one_trn.cleared then
  929.         begin
  930.           gotoxy (20,5);
  931.           case one_trn.check_tran of
  932.             cdeposit  :  write ('Checking Deposit     ');
  933.             cwithdrawl  :  write ('Checking Withdrawl');
  934.             cinterest   :  write ('Checking Interest ');
  935.             sdeposit    :  write ('Savings Deposit   ');
  936.             swithdrawl  :  write ('Savings Withdrawl ');
  937.             sinterest   :  write ('Savings Interest  ');
  938.           end;  { case }
  939.           gotoxy (20,6);  write ('Posting Date : ',one_trn.post_date);
  940.           gotoxy (20,7);  write ('Check No.    : ',one_trn.check_no:5);
  941.           gotoxy (20,8);  write ('Written to   : ',one_trn.to_who);
  942.           gotoxy (20,9);  write ('Amount       : ',one_trn.amount:8:2);
  943.           gotoxy (20,10); write ('Memo         : ',one_trn.memo);
  944.           gotoxy (10,12); write ('Has this Cleared  [Yes, No, Quit] ? ');
  945.           repeat read (kbd, ch); until ch in yes_no + ['Q','q'];
  946.           if ch in ['Y','y'] then
  947.             begin
  948.               tc := tc + 1;
  949.               one_trn.cleared := true;
  950.               seek (trnfile, tt-1);
  951.               write (trnfile, one_trn);
  952.             end
  953.           else
  954.             if ch in ['Q','q'] then
  955.                while not eof(trnfile) do
  956.                  begin
  957.                    read (trnfile, one_trn);
  958.                    tt := tt + 1;
  959.                  end;
  960.         end;
  961.     end; { while }
  962.   clrscr;
  963.   writeln;
  964.   writeln ('    Total Transactions = ',tt:5);
  965.   writeln ('    Total Cleared      = ',tc:5);
  966.   write   ('    Press any key to Return ');
  967.   read (kbd,ch);
  968.   move (temp_screen, real_screen, 4000);
  969. end;  { clear_entries }
  970.  
  971. procedure Summary;
  972. var
  973.   tt, tc : integer;
  974. begin
  975.   tt := 0;  tc := 1;
  976.   move (real_screen, temp_screen, 4000);
  977.   drawbox (8,10,66,17,white,green,'[ Summary Print ]',blink_yes);
  978.   flush (trnfile);
  979.   reset (trnfile);
  980.   writeln;
  981.   writeln ('    Make sure your Printer is ON.');
  982.   writeln ('    Press ''Y'' to continue or any other key to Exit');
  983.   read (kbd, ch);
  984.   writeln;
  985.   if ch in ['Y','y'] then
  986.     begin
  987.       textcolor (yellow);
  988.       writeln ('    Printing Transaction File.');
  989.       write   ('    Press any key to Abort.');
  990.       writeln (lst,#15,#27,#85);
  991.       while not eof(trnfile) do
  992.         begin
  993.           if tt = 0 then
  994.             begin
  995.               for x := 1 to 3 do writeln (lst,'');
  996.               writeln (lst,'                     PC-Check  Summary sheet for transaction file ',filename,'      Page ',tc:2);
  997.               writeln (lst,'');
  998.               write   (lst,'Code    Cleared   Tran Date          Written                                Reason');
  999.               writeln (lst,'                         Amount   Check No.');
  1000.               writeln (lst,'');
  1001.               tt := 7;
  1002.             end;
  1003.           read (trnfile, one_trn);
  1004.           tt := tt + 1;
  1005.           write (lst,'  ');
  1006.           case one_trn.check_tran of
  1007.             cdeposit   : write (lst,'CD ');
  1008.             cwithdrawl : write (lst,'CW ');
  1009.             cinterest  : write (lst,'CI ');
  1010.             sdeposit   : write (lst,'SD ');
  1011.             swithdrawl : write (lst,'SW ');
  1012.             sinterest  : write (lst,'SI ');
  1013.           end;  { case }
  1014.           if one_trn.cleared then
  1015.             write (lst,'     Y')
  1016.           else
  1017.             write (lst,'     N');
  1018.           write (lst,'       ',one_trn.post_date:8);
  1019.           write (lst,'    ',one_trn.to_who:40);
  1020.           write (lst,'  ',one_trn.memo:30);
  1021.           write (lst,'  ',one_trn.amount:8:2);
  1022.           write (lst,'    ',one_trn.check_no:5);
  1023.           writeln (lst,'');
  1024.           if tt = 62 then
  1025.             begin
  1026.               for x := 1 to 4 do writeln (lst,'');
  1027.               tc := tc + 1;
  1028.               tt := 0;
  1029.             end;
  1030.           if keypressed then
  1031.             begin
  1032.               read (kbd, ch);
  1033.               seek (trnfile, filesize(trnfile));
  1034.             end;
  1035.       end; { while }
  1036.     end;
  1037.   move (temp_screen, real_screen, 4000);
  1038. end;
  1039.  
  1040. procedure Browse;
  1041. var
  1042.   tt, tc : integer;
  1043. begin
  1044.   tt := 0;  tc := 1;
  1045.   edit_ok := false;
  1046.   move (real_screen, temp_screen, 4000);
  1047.   drawbox (2,10,79,23,white,black,'[ Browse Transaction File  -- ' + filename + ']',blink_yes);
  1048.   flush (trnfile);
  1049.   reset (trnfile);
  1050.   tt := filesize(trnfile);
  1051.   textcolor (yellow);
  1052.   if tt = 0 then
  1053.     begin
  1054.       writeln;
  1055.       gotoxy (20,5); writeln ('     The file is Empty!');
  1056.       gotoxy (20,6); write   ('     Press any key to Return ');
  1057.       repeat until keypressed;
  1058.       read (kbd, ch);
  1059.     end
  1060.   else
  1061.     begin
  1062.       writeln ('    Valid keys are -');
  1063.       writeln ('    (F)irst (L)ast (N)ext (P)revious (Q)uit (E)dit');
  1064.       writeln ('    (+) Skip 10 Forward   (-) Skip 10 Back');
  1065.       repeat
  1066.         window (3,11,78,22);
  1067.         textcolor (Lightgray);
  1068.         gotoxy (20,4); write (' '); gotoxy (20,4);
  1069.         repeat read (kbd,ch); until ch in ['F','f','L','l','N','n','P','p','Q','q','+','-','E','e'];
  1070.         if ch in ['Q','q'] then
  1071.           begin end
  1072.         else
  1073.           begin
  1074.             case ch of
  1075.               'F','f'   :  begin
  1076.                              tc := 1;
  1077.                              seek (trnfile, tc - 1);
  1078.                            end;
  1079.               'L','l'   :  begin
  1080.                              tc := tt;
  1081.                              seek (trnfile, tc - 1);
  1082.                            end;
  1083.               'N','n'   :  begin
  1084.                              tc := tc + 1;
  1085.                              if tc > tt then tc := tt;
  1086.                              seek (trnfile, tc - 1);
  1087.                            end;
  1088.               'P','p'   :  begin
  1089.                              tc := tc - 1;
  1090.                              if tc = 0 then tc := 1;
  1091.                              seek (trnfile, tc - 1);
  1092.                            end;
  1093.               '+'       :  begin
  1094.                              tc := tc + 10;
  1095.                              if tc > tt then tc := tt;
  1096.                              seek (trnfile, tc - 1);
  1097.                            end;
  1098.               '-'       :  begin
  1099.                              tc := tc - 10;
  1100.                              if tc <= 0 then tc := 1;
  1101.                              seek (trnfile, tc - 1);
  1102.                            end;
  1103.               'E','e'   :  begin
  1104.                              if edit_ok then
  1105.                                begin
  1106.                                  move (real_screen, temp_screen2, 4000);
  1107.                                  drawbox (15,6,74,14,lightred+blink,black,'[ EDIT Tran ]',blink_yes);
  1108.                                  check_num_h := one_trn.check_no;
  1109.                                  to_who_h := one_trn.to_who;
  1110.                                  amount_h := one_trn.amount;
  1111.                                  memo_h := one_trn.memo;
  1112.                                  check_tran_h := one_trn.check_tran;
  1113.                                  repeat
  1114.                                    textcolor (lightgreen);
  1115.                                    gotoxy (2,1);
  1116.                                    case one_trn.check_tran of
  1117.                                      cdeposit    :  write ('Checking Deposit     ');
  1118.                                      cwithdrawl  :  write ('Checking Withdrawl');
  1119.                                      cinterest   :  write ('Checking Interest ');
  1120.                                      sdeposit    :  write ('Savings Deposit   ');
  1121.                                      swithdrawl  :  write ('Savings Withdrawl ');
  1122.                                      sinterest   :  write ('Savings Interest  ');
  1123.                                    end;  { case }
  1124.                                    gotoxy (2,2);  write ('Posting Date : ',one_trn.post_date);
  1125.                                    gotoxy (2,3);  write ('Check No.    : ',one_trn.check_no:1,'        ');
  1126.                                    gotoxy (2,4);  write ('Written to   : ',one_trn.to_who);
  1127.                                    gotoxy (2,5);  write ('Amount       : ',one_trn.amount:1:2,'        ');
  1128.                                    gotoxy (2,6);  write ('Memo         : ',one_trn.memo);
  1129.                                    { get date }
  1130.                                    textcolor (lightcyan);
  1131.                                    repeat
  1132.                                      temp_date := readdate(17,2,one_trn.post_date);
  1133.                                      { get check number }
  1134.                                      repeat
  1135.                                        gotoxy (17,3);  buflen := 5;  readln (n_check_num);
  1136.                                        val (n_check_num, check_num, rc);
  1137.                                        if rc <> 0 then
  1138.                                          begin
  1139.                                            gotoxy (5,7);
  1140.                                            writeln ('Error : Numeric input only.');
  1141.                                          end;
  1142.                                      until rc = 0;
  1143.                                      gotoxy (5,7); clreol;
  1144.                                      if check_num = 0 then check_num := check_num_h;
  1145.                                      { get to_who }
  1146.                                       gotoxy (17,4);  buflen := 40; readln (to_whom);
  1147.                                      if to_whom = '' then to_whom := to_who_h;
  1148.                                      { get amount }
  1149.                                      repeat
  1150.                                        gotoxy (17,5);  buflen := 8;  readln (n_amount);
  1151.                                        if n_amount = '' then
  1152.                                          begin
  1153.                                            rc := 0;
  1154.                                            new_amount := amount_h
  1155.                                          end
  1156.                                        else
  1157.                                          begin
  1158.                                            val (n_amount, new_amount, rc);
  1159.                                            if rc <> 0 then
  1160.                                              begin
  1161.                                                gotoxy (5,7);
  1162.                                                writeln ('Error in Amount at position ',rc:1);
  1163.                                              end;
  1164.                                          end;
  1165.                                      until rc = 0;
  1166.                                      gotoxy (5,7); clreol;
  1167.                                      { get memo }
  1168.                                      gotoxy (17,6);  buflen := 30; readln (new_memo);
  1169.                                      if new_memo = '' then new_memo := memo_h;
  1170.                                      while length(new_memo) < 30 do new_memo := new_memo + ' ';
  1171.                                      while length(to_whom) < 40 do to_whom := to_whom + ' ';
  1172.                                      gotoxy (5,7);   write ('Is this check right  (Y/N)  ');
  1173.                                      repeat read (kbd, ch2); until ch2 in yes_no;
  1174.                                      case ch2 of
  1175.                                        'N','n'  :  begin
  1176.                                                      gotoxy (5,7);
  1177.                                                      write ('Do you want to EXIT (Y/N)  ');
  1178.                                                      repeat read (kbd, ch1); until ch1 in yes_no;
  1179.                                                    end;
  1180.                                        'Y','y'  :  ch1 := 'N';
  1181.                                     end; { case }
  1182.                                   until (ch2 in ['Y','y']) or (ch1 in ['Y','y']);
  1183.                                   if ch2 in ['Y','y'] then
  1184.                                     begin
  1185.                                       with one_trn do
  1186.                                         begin
  1187.                                           post_date := temp_date;
  1188.                                           check_no  := check_num;
  1189.                                           to_who    := to_whom;
  1190.                                           amount    := new_amount;
  1191.                                           memo      := new_memo;
  1192.                                           check_tran := check_tran_h;
  1193.                                           cleared    := false;
  1194.                                         end; { with }
  1195.                                       seek (trnfile, tc - 1);
  1196.                                       write (trnfile, one_trn);
  1197.                                     end;
  1198.                                     gotoxy (5,7);
  1199.                                   if ch1 in ['y','Y'] then
  1200.                                     begin end
  1201.                                   else
  1202.                                     begin
  1203.                                       write ('Do you want to EXIT (Y/N)  ');
  1204.                                       repeat read (kbd, ch1); until ch1 in yes_no;
  1205.                                     end;
  1206.                                  until ch1 in ['y','Y'];
  1207.                                  move (temp_screen2, real_screen, 4000);
  1208.                                end
  1209.                            end
  1210.             end; { case }
  1211.             if ch in ['E','e'] then
  1212.               begin end
  1213.             else
  1214.               begin
  1215.                 read (trnfile, one_trn);
  1216.                 edit_ok := true;
  1217.                 gotoxy (15,5); writeln ('Transaction Number ',tc:1,'        ');
  1218.                 gotoxy (15,6);
  1219.                 case one_trn.check_tran of
  1220.                   cdeposit  :  write ('Checking Deposit     ');
  1221.                   cwithdrawl  :  write ('Checking Withdrawl');
  1222.                   cinterest   :  write ('Checking Interest ');
  1223.                   sdeposit    :  write ('Savings Deposit   ');
  1224.                   swithdrawl  :  write ('Savings Withdrawl ');
  1225.                   sinterest   :  write ('Savings Interest  ');
  1226.                 end;  { case }
  1227.                 gotoxy (15,7);  write ('Posting Date : ',one_trn.post_date);
  1228.                 gotoxy (15,8);  write ('Check No.    : ',one_trn.check_no:1,'        ');
  1229.                 gotoxy (15,9);  write ('Written to   : ',one_trn.to_who);
  1230.                 gotoxy (15,10); write ('Amount       : ',one_trn.amount:1:2,'        ');
  1231.                 gotoxy (15,11); write ('Memo         : ',one_trn.memo);
  1232.               end;
  1233.           end;
  1234.       until ch in ['Q','q'];
  1235.     end;
  1236.   move (temp_screen, real_screen, 4000);
  1237. end;
  1238.  
  1239. procedure main_options;
  1240. begin
  1241.   repeat
  1242.     drawbox (1,15,80,24,lightcyan,black,'[ Main Menu ]',blink_yes);
  1243.     writeln (' Options :');
  1244.     writeln ('           1)  Add Transactions           4)  Show Balance Sheet');
  1245.     writeln ('           2)  Clear Transactions         5)  Print Summary ');
  1246.     writeln ('           3)  Change Transaction File    6)  Browse Transaction File');
  1247.     writeln ('                                          7)  Exit PC-Check');
  1248.     write   ('                  Your choice ? ');
  1249.     repeat
  1250.       read (kbd,ch);
  1251.     until ch in ['1'..'7'];
  1252.     drawbox_ibm (1,15,80,24,lightcyan,black,'[ Main Menu ]',blink_no);
  1253.     case ch of
  1254.       '1'      : Add_a_trn;
  1255.       '4'      : Balance_sheet;
  1256.       '2'      : clear_entries;
  1257.       '5'      : Summary;
  1258.       '3'      : open_files;
  1259.       '6'      : Browse;
  1260.       '7'      : big_exit;
  1261.     end;
  1262.   until done;
  1263. end;
  1264.  
  1265. procedure Opening_screen;
  1266. begin
  1267.   screen_off;
  1268.   drawbox (2,1,79,24,white,black,'',blink_no);
  1269.   writeln;
  1270.   writeln('       PC-Check Copyright (c)  The Forbin Project and John Friel III');
  1271.   writeln;
  1272.   writeln('       If you find this program of value,  the Forbin Project requests');
  1273.   writeln('       a donation of  only $5.00.   Those that do donate will  receive');
  1274.   writeln('       published announcements for future enhancements to PC-Check and');
  1275.   writeln('       other programs written by the Forbin Project.  PC-Check may  be');
  1276.   writeln('       transferred  to  other people  under two (2) conditions;   that');
  1277.   writeln('       there is NO CHARGE  for the copy(s) and that the source program');
  1278.   writeln('       not be modified in  any way, shape or form.');
  1279.   writeln('       The  user   may   modify  the   source  code  to  suit  his  or');
  1280.   writeln('       her own personal tastes.    All rights  reserved by the  Forbin');
  1281.   writeln('       Project.  Please keep an unmodified  copy  around just for this');
  1282.   writeln('       purpose.  For  more  information   on  this  program  or   more');
  1283.   writeln('       detailed information on interfacing  TURBO Pascal  with the IBM');
  1284.   writeln('       PC  or  Compatibles,  please write to the Forbin Project at :');
  1285.   writeln;
  1286.   writeln('                          The Forbin Project');
  1287.   writeln('                          John Friel III');
  1288.   writeln('                          715 Walnut Street');
  1289.   writeln('                          Cedar Falls, Iowa  50613');
  1290.   screen_on;
  1291.   repeat until keypressed;
  1292.   read (kbd,ch);
  1293.   window (1,1,80,24);
  1294.   clrscr;
  1295. end;
  1296.  
  1297.  
  1298. begin    {Check_book}
  1299.   opening_screen;
  1300.   init;
  1301.   open_files;
  1302.   main_options;
  1303. end.